<template>
  <view class="cx-popup-notification">
    <u-popup
      :show="isLikeShow"
      mode="center"
      :round="5"
      @close="onLikeClose"
      :closeOnClickOverlay="true"
    >
      <view class="pop-ul">
        <view
          class="pop-li"
          :class="{ active: type == item.value }"
          v-for="(item, index) in clothArray"
          :key="index"
          @click="onCheck(item)"
        >
          <u-icon
            name="checkbox-mark"
            color="#fff"
            class="m-r-20"
            size="24"
            v-if="type == item.value"
          ></u-icon>
          {{ item.label }}
        </view>
      </view>
    </u-popup>
  </view>
</template>

<script>
export default {
  name: "cx-popup-notification",
  props: {
    type: {
      type: Number | String | null,
      default: "",
    },
    clothArray: {
      type: Array,
      default: [],
    },
    show: {
      type: Boolean,
      default: false,
    },
  },
  data() {
    return {
      isLikeShow: false,
    };
  },
  watch: {
    show(n, old) {
      
      this.isLikeShow = n
    },
  },
  onLoad() {
    this.isLikeShow = this.show;
  },
  methods: {
    onLikeClose() {
      this.$emit("onLikeClose");
      
    },
    onCheck(item) {
      this.$emit("onCheck", item);
    },
  },
};
</script>

<style lang="scss" scoped>
.cx-popup-notification {
}
</style>
